(import
 (except (rnrs base) error vector-map)
 (only (guile) lambda* λ error)
 ;; SRFI-64 for unit testing
 (srfi srfi-64)
 (unbalanced-set))


(test-begin "unbalanced-set-test")


(test-group "make-empty-set"

  (test-assert "make-empty-set returns an empty set - 01"
    (set-empty? (make-empty-set <)))

  (test-assert "make-empty-set returns an empty set - 02"
    (not (set-member? (make-empty-set <) 123))))


(test-group "set-empty?"

  (test-assert "set-empty? returns true for an empty set"
    (set-empty? (make-empty-set <)))

  (test-assert "set-empty? returns false for a non-empty set"
    (not (set-empty? (set-insert (make-empty-set <) 123)))))


(test-group "set-member?"

  (test-assert "set-member? returns true for a set member"
    (set-member? (set-insert (make-empty-set <) 123) 123))

  (test-assert "set-member? returns false for a value not in the set"
    (not (set-member? (set-insert (make-empty-set <) 123) 456))))


(test-group "set-insert"
  (test-assert "set-insert inserts a value"
    (set-member? (set-insert (make-empty-set <) 123) 123)))


(test-end "unbalanced-set-test")
